<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>K吧</title>
<link rel="stylesheet" type="text/css" href="<s:property value="staticsRoot"/>/css/front-style.css"/>
<link href="http://www.7k7kjs.cn/qike_public/qike-sns.min.css" rel="stylesheet" />
<script src="http://www.7k7kjs.cn/js/lib/jquery/1.7.2/jquery-min.js"></script>
<script src="http://www.7k7kjs.cn/qike_public/qike-sns.min.js"></script>
<script>document.domain = "7k7k.com";</script>
<script type="text/javascript" src="<s:property value="staticsRoot"/>/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(".mess #yzm").click(function(){
		$(".mess li span").removeClass("dis_none");
	});
});
function doSubmit(){
	var friBarName = $("#friNameId").val();
	var barId = $("#barId").val();
	if(friBarName==''){
		alert("友情吧名称不能为空")
		return false;
	}
	$.getJSON("ajaxCheckFriBarCount.html", {"barId":barId}, function(result){
			if ($.trim(result.status)=="0"){
			$("#errorMes").html("系统错误，请稍后再尝试");
			}else if ($.trim(result.status)=="1"){				
				$("#errorMes").html("系统最多允许添加"+result.count+"个友情吧，请删除后在添加");
				return false;
			}else{
			$("#form1").submit();
			}
		}, "json");
	}
</script>
<style type="text/css">
<s:if test="barDO.image	!=null	&&	barDO.image !='noImage'"> 
body{
	
    background: url(<s:property value="barDO.image"/>);
    background-repeat: no-repeat;
    background-position:center top;
   
}
.no-bg {
	background: #fff;
	width: 1210px;
	margin: 0px auto;
}
</s:if>
</style>
</head>

<body>
<s:if test="barDO.image	!=null	&&	barDO.image !='noImage'"> 
<div class="no-bg">
</s:if>
<s:include value="include/header.jsp"/>
<s:include value="include/guide.jsp"/>
<div class="mian">
<div class="right fl">
        <div class="lit_nav">
        	<h3>版面管理</h3>
            <ul>
            	<li class="on"><span>&middot;</span><a href="./barManager.html?barId=<s:property value="#request.barId"/>">友情吧管理</a></li>
                <li ><span>&middot;</span><a href="./category.html?barId=<s:property value="#request.barId"/>">帖子分区管理</a></li>
            </ul>
        </div>
    </div>
	<div class="left fr">
    	<ul class="tab_ul">
        	<li class="on"><a href="./barManager.html?barId=<s:property value="#request.barId"/>">友情吧管理</a></li>
        </ul>
        <ul class="mess">
        <s:iterator value="#request.list" var="friBar">
            <li>
            	<a href="##"><s:property value="#friBar.friBarName"/>吧&nbsp;</a> <a href="./delFriBar.html?friBarId=<s:property value="#friBar.id"/>&barId=<s:property value="#request.barId"/>">删除</a>
   	    	</li>
            </s:iterator>
            <form name="form1" id="form1" action="addFriBar.html" method="post">
            <li>
           		 <input type="hidden" class="i_text" id="barId" name = "barId" value = "<s:property value="#request.barId"/>"/>
            	 <input id= "friNameId"  type="text" class="i_text"  name = "friBarName" />&nbsp;吧&nbsp;<input type="button" onclick="doSubmit();" value="添加友情吧"  />
            	 <span id="errorMes" class="red"></span>
   	    	</li>
   	    	</form>
        </ul>
    </div>
    <div class="clearB"></div>
</div>
<s:include value="include/foot.jsp"/>
<s:if test="barDO.image	!=null	&&	barDO.image !='noImage'"> 
</div>
</s:if>
</body>
</html>
